package top.buyibuyi.course.pojo;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

public
class PageBean<T> implements Serializable {
    private int page;//当前页数
    private int limit;//每页显示数
    private int totalPage;//总页数
    private int total;//总记录数

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getLimit() {
        return limit;
    }

    public void setLimit(int limit) {
        this.limit = limit;
    }

    public int getTotalPage() {
        return totalPage;
    }

    /*public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }*/

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
        this.totalPage = (int)Math.ceil((((double)total)/limit));
    }

    public List<T> getPageRecode() {
        return pageRecode;
    }

    public void setPageRecode(List<T> pageRecode) {
        this.pageRecode = pageRecode;
    }

    public Boolean getHasPrevPage() {
        return hasPrevPage;
    }

    public void setHasPrevPage(Boolean hasPrevPage) {
        this.hasPrevPage = hasPrevPage;
    }

    public Boolean getHasNextPage() {
        return hasNextPage;
    }

    public void setHasNextPage(Boolean hasNextPage) {
        this.hasNextPage = hasNextPage;
    }

    public List<Integer> getPages() {
        return pages;
    }

    public void setPages(List<Integer> pages) {
        this.pages = pages;
    }

    private List<T> pageRecode;//当前页面的数据集合
    private Boolean hasPrevPage;
    private Boolean hasNextPage;
    private List<Integer> pages;//返回页数的集合，用于显示index页面的上一页、下一页
}